<template>
  <div class="flex-col justify-start page">
    <c-title :hide="false" v-bind:text="sign_name" tolink="signrules"></c-title>
    <div class="flex-col group">
      <div class="head">
        <div style="text-align: left">贡献值数量</div>
        <div class="num">{{mc_member.credit4}}</div>
        <div class="gz" @click="gonglue">规则说明</div>
      </div>

      <div class="flex-col self-stretch section_3">
        <div class="flex-row group_2">
          <div class="section_4"></div>
          <span class="text_5 ml-7">贡献值明细</span>
        </div>
        <div class="flex-col mt-13">
          <div class="flex-row justify-between self-stretch list-item" v-for="(item, index) in items" :key="fenhongindex">
            <div class="flex-col self-center group_3">
              <span class="self-start font_2 text_6">{{item.remark}}</span>
              <span class="self-stretch font_4 text_11 mt-9">{{item.create_time}}</span>
            </div>
            <span class="self-start font_3 text_7" v-if="item.status > 0">+{{item.point}}</span>
            <span class="self-start font_3 text_7" v-else>-{{item.point}}</span>
          </div>
        </div>
      </div>
    </div>
    <van-popup v-model="gzShow" :style="{ borderRadius: '10px',width:'90%',height:'500px',textAlign:'left'}" closeable>
      <div v-html="gongluestr" style="padding: 55px 10px 10px 10px;"></div>
    </van-popup>



  </div>
</template>
<script>
import { Toast } from "vant";

export default {
  components: {},
  props: {},
  data() {
    return {
      sign_name:'分红池',
      gongluestr:'',
      items: [],
      page: 1,
      gzShow:false,
      zhShow:false,
      mc_member: ''
    };
  },
  mounted() {
    this.getTotal()
    this.getList()
  },
  //下滑加载
  onReachBottom() {
    this.page = this.page + 1
    this.getList()
  },
  methods: {
    gongxianzhi(){
      let _query = {
        i: this.fun.getKeyByI(),
        type: this.fun.getTyep(),
        mid: this.fun.getKeyByMid()
      };
      this.$router.push("/fenhonglist?i=" + _query.i + '&type='+_query.type + '&mid=' + _query.mid);
    },
    submitshifang(){
      this.zhShow = false
      this.zhuanhuan()
    },
    shifang(){
      this.zhShow = true
    },
    gonglue(){
      this.gzShow = true
    },
    zhuanhuan(){
      $http.get('test.fhzhuanhuan', {}).then(response => {
        if (response.result === 1) {
          this.$toast('转换成功')
        }else{
          this.$toast(response.msg)
        }
      })
    },
    getTotal() {
      $http.get('test.fhtotal', {}).then(response => {
        if (response.result === 1) {
          this.mc_member = response.data
        }
      })
    },
    getList() {
      $http.get('test.gxzfhlist', {page:this.page}).then(response => {
        this.gongluestr = response.data.guizheshuoming
        if (response.result === 1) {

          if(this.page == 1){
            this.items = response.data.data
          }else{
            this.items = this.items.concat(response.data.data)
          }
        }
      })
    }
  },
};
</script>
<style scoped lang="scss">
.ml-7 {
  margin-left: 7px;
}
.mt-13 {
  margin-top: 13px;
}
.mt-9 {
  margin-top: 9px;
}
.page {
  background-color: #f4f4f4;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  .group {
    margin-top: 10px;
    overflow-y: auto;
    .header {
      padding-bottom: 11.5px;
      .section {
        padding: 45px 0 5px;
        background-image: url('https://ide.code.fun/api/image?token=65ea8c72ba406d00116038d4&name=eb74e0347d34f59ca54a3a11d6f13c8e.png');
        background-size: 100% 100%;
        background-repeat: no-repeat;
        background-color: #ffffff;
        .text-wrapper {
          padding: 6.5px 0 8.5px;
          background-color: #ededed;
          width: 81px;
          .text {
            color: #3d3d3d;
          }
        }
      }
      .section_2 {
        padding: 16px 14.5px 14.5px 18px;
        background-color: #ffffff;
        .image {
          width: 16px;
          height: 16px;
        }
        .pos {
          position: absolute;
          left: 18px;
          top: 50%;
          transform: translateY(-50%);
        }
        .text_2 {
          color: #333333;
          line-height: 15px;
        }
        .text_3 {
          line-height: 13px;
        }
        .pos_2 {
          position: absolute;
          right: 14.5px;
          top: 50%;
          transform: translateY(-50%);
        }
      }
      .font {
        font-size: 16px;
        font-family: SourceHanSansCN;
        line-height: 15px;
      }
    }
    .image_2 {
      width: 93.6vw;
      height: 30.6667vw;
    }
    .text-wrapper_2 {

      padding: 11.5px 0 9.5px;
      background-color: #ffeb3b;
      border-radius: 100px;
      width: 192px;
      margin: auto;
      .text_4 {
        color: #fd413f;
        line-height: 13px;
      }
    }
    .font_2 {
      font-size: 14px;
      font-family: SourceHanSansCN;
      line-height: 12px;
      color: #3d3d3d;
    }
    .section_3 {
      margin: 34px 11px 0 14px;
      padding: 14.5px 0 216.5px;
      background-color: #ffffff;
      border-radius: 10px 10px 0 0;
      .group_2 {
        padding: 0 11.5px;
        .section_4 {
          background-color: #f93728;
          border-radius: 100px;
          width: 4px;
          height: 15.5px;
        }
        .text_5 {
          margin-top: 1px;
          color: #3d3d3d;
          font-size: 15px;
          font-family: SourceHanSansCN;
          line-height: 14px;
        }
      }
      .list-item {
        padding: 15px 9.5px 11px 15.5px;
        border-bottom: solid 0.5px #f4f4f4;
        .group_3 {
          .text_6 {
            line-height: 13px;
          }
          .font_4 {
            font-size: 14px;
            font-family: SourceHanSansCN;
            line-height: 18px;
            color: #999999;
          }
          .text_11 {
            font-size: 13px;
          }
        }
        .font_3 {
          font-size: 16px;
          font-family: SourceHanSansCN;
          line-height: 12px;
          color: #fe6532;
        }
        .text_7 {
          margin-top: 10.5px;
        }
      }
    }
  }
}
.num {
  font-weight: 600;
  font-size: 28px;
  color: #ffeb3b;
  text-align: left;
  margin-bottom: 5px;
}
.dfix {
  display: flex;margin-bottom: 15px;justify-content: space-between;
  margin-top: 10px;
  background: #e93737;
  padding: 3px 5px 3px 5px;
  border-radius: 5px;
}
.gz {
  position: absolute;
  top: 15px;
  right: 20px;
}
.head {
  background: rgb(254, 69, 77);
  padding: 10px;
  color: white;
  position: relative;
  width: 94%;
  margin: auto;
  border-radius: 15px;
}
.c-section {
  padding: 28px 18px 49px;
  background-color: #ffffff;
  border-radius: 20px;
  .c-text {
    color: #000000;
    font-size: 17px;
    font-family: SourceHanSansCN;
    line-height: 16px;
  }
  .c-mt-42 {
    margin-top: 42px;
    .c-font {
      font-size: 15px;
      font-family: SourceHanSansCN;
      line-height: 14.5px;
      color: #3d3d3d;
    }
    .c-text_1 {
      color: #000000;
      line-height: 14px;
    }
    .c-text_2 {
      color: #fd413f;
    }
    .c-mt-13 {
      margin-top: 13px;
    }
    .c-text-wrapper {
      padding: 12px 0;
      background-color: #e5e5e5;
      border-radius: 100px;
      width: 120px;
      height: 40px;
      .c-text_3 {
        color: #383838;
        line-height: 14px;
      }
    }
    .c-ml-12 {
      margin-left: 12px;
      .c-text_4 {
        color: #ffffff;
        line-height: 14px;
      }
    }
    .c-text-wrapper_1 {
      padding: 12px 0;
      background-color: #fd413f;
      border-radius: 100px;
      width: 120px;
      height: 40px;
    }
  }
}
</style>